namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a TrigonometricPolynomial class.
    /// </summary>
    public interface ITrigonometricPolynomial
    {
        /// <summary>
        /// Gets or sets the constant value a0 of the trigonometric polynomial.
        /// </summary>
        /// <value>The a0.</value>
        double A0 { get; set; }

        /// <summary>
        /// Gets the degree of the trigonometric polynomial.
        /// </summary>
        /// <value>The degree of the trigonometric polynomial.</value>
        int Degree { get; }

        /// <summary>
        /// Gets or sets the <see cref="SmartMathLibrary.TrigonometricPolynomialComponent"/> at the specified index.
        /// </summary>
        /// <value>The trigonometric polynomial component at the specified position.</value>
        TrigonometricPolynomialComponent this[int index] { get; set; }

        /// <summary>
        /// Compares the current instance of a trigonometric polynomial to another one.
        /// </summary>
        /// <param name="compare">The trigonometric polynomial to compare.</param>
        /// <returns>True if the trigonometric polynomial are even otherwise, false.</returns>
        bool CompareTo(TrigonometricPolynomial compare);

        /// <summary>
        /// Adds a trigonometric polynomial component to the current instance.
        /// </summary>
        /// <param name="component">The component to add.</param>
        void AddComponent(TrigonometricPolynomialComponent component);

        /// <summary>
        /// Removes a trigonometric polynomial component from the current instance.
        /// </summary>
        /// <param name="index">The specified index, where the component should be removed.</param>
        void RemoveComponentAt(int index);

        /// <summary>
        /// Copies the current instance.
        /// </summary>
        /// <returns>A copy of the current instance.</returns>
        TrigonometricPolynomial Copy();

        /// <summary>
        /// Solves the trigonometric polynomial at the specified position x.
        /// </summary>
        /// <param name="x">The value for evaluation.</param>
        /// <returns>The result t(x) at the specified position x.</returns>
        double SolveAt(double x);
    }
}